/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * main.c
 * Copyright (C) Kellerman Rivero 2011 <krsloco@gmail.com>
 * 
 * Keejoo is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Keejoo is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*Programado por Kellerman Rivero*/

#include <config.h>
#include <gtk/gtk.h>
//#include "keejoo.h"
#include "login.h"


//#include "xml_twitter.h"
#include <stdlib.h>

#include <glib/gi18n.h>


char *oauth_token = NULL;
char *oauth_token_secret = NULL;
char *access_token_key = NULL;
char *access_token_secret = NULL;
char *username = NULL;
WidgetLogin *LoginWindow;


int
main (int argc, char *argv[])
{

 username = (char*) malloc(sizeof(char));


 LoginWindow = (_WidgetLogin*) malloc (sizeof(_WidgetLogin));	

  gtk_init (&argc, &argv);

#ifdef ENABLE_NLS
	bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
#endif

  /*if(DEBUG_MODE){
	   debug_print ("Main","DEBUG_MODE","Autenticacion","Introduzca el nombre de usuario");
	   scanf("%s",username);
	   if(load_file_with_access_token (username,&access_token_key,&access_token_secret)){
		    debug_print ("Main","DEBUG_MODE","Autenticacion","CARGADO!");
		    debug_print ("Main","DEBUG_MODE","Access_token_key",access_token_key);
		    debug_print ("Main","DEBUG_MODE","Access_token_secret",access_token_secret);
	   }else{
		   
*/
		   
/*
		    char access_token_url[MAX_URL_LENGTH];

		   strcpy(access_token_url,ACCESS_TOKEN_URL);
		   strcat(access_token_url,"?oauth_verifier=");
		   strcat(access_token_url,verifier);
		   

			get_token (access_token_url,&access_token_key,&access_token_secret,oauth_token,oauth_token_secret,&username);*/
		    
			//access_token(oauth_token,oauth_token_secret,verifier,&access_token_key,&access_token_secret,&username);

	/*		get_token (ACCESS_TOKEN_URL,&access_token_key,&access_token_secret,oauth_token,oauth_token_secret,&username);
		   
			create_file_with_access_token (username,access_token_key,access_token_secret);

		    char *document=get_resource (UPDATE_STATUS_URL_TEST,access_token_key,access_token_secret);
		    //debug_print ("Keejoo","Main","Document",document);
		    long int l_document=strlen(document);
			
		
			xmlDocPtr doc = build_xml_tree_from_memory(document,l_document);
		    xmlNodeSetPtr nodes = eval_xpath_expression (doc,"//profile_image_url");
			
		
		                                                 
		    print_xpath_nodes(nodes);
	   }
}*/
	//debug_print("Main","Main","filename",get_image_name ("/IMG00068-20101228-1113_normal.jpg"));
  /*app = keejoo_new ();
  status = g_application_run (G_APPLICATION (app), argc, argv);
  g_object_unref (app);

  return status;*/

 
  LoginWindow = create_window_login();
	
  gtk_widget_show (LoginWindow->Window);

  gtk_main ();

  return 0;
}

